#include"heap.h"

#include<exception>
#include<iostream>

int main() {
	Heap<int> h(5);
	h . insert(6);
	h . insert(2);
	h . insert(7);
	h . insert(4);
	Heap<int> heap(h);
	std::cout << h . extractMin() << std::endl;
	std::cout << h . extractMin() << std::endl;
	std::cout << h . extractMin() << std::endl;
	std::cout << h . extractMin() << std::endl;
	std::cout << h . extractMin() << std::endl;
	try {
		std::cout << h . extractMin() << std::endl;
	} catch (std::out_of_range & e) {
		std::cerr << e . what() << std::endl;
	}
	try {
		std::cout << h . peekMin() << std::endl;
	} catch (std::out_of_range & e) {
		std::cerr << e . what() << std::endl;
	}
	h = heap;
	return 0;
}
